<template>
<el-dialog
    id="dialog"
    :model-value="dialogTableVisible"
    :title="dialogTitle"
    width="50%"
    @close="handleClose"
    
  >

  
    <el-table :data="tableData" style="width: 100%">
            <el-table-column :prop="item.prop" :label="item.lable" v-for="(item,index) in options" :key="index">
            
            </el-table-column>
        </el-table>
  
          
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="handleClose">返回</el-button>
        
      </span>
    </template>
  </el-dialog>
</template>



<script setup>
import {defineEmits,ref,defineProps,watch} from 'vue';
import {$meetingPartSearch} from '@/api/meetingapi'
import {options} from './Partoptions'
import { ElMessage } from 'element-plus'
const props = defineProps({
  dialogTitle:{
    type:String,
    default:'',
    required:true
  },
  dialogTableValue:{
    type:Object,
    default:()=>{}
  }
})
const tableData =ref([]) 
const formRef=ref(null)

const meetingId = ref({
  meetingId: "",

})


const form = ref({
  meeting_id: "",
  user_id: "",
})

watch (
  ()=>props.dialogTableValue,
  ()=>{
    
    meetingId.value=props.dialogTableValue
  },
  {deep:true,immediate:true})

const loadData = async () => {
    console.log(meetingId.value,"meetingId")
    /* 
    var Dialog =document.getElementById("dialog");
    console.log(Dialog.textContent)
    const match = Dialog.textContent.match(/\d+/);
    console.log(match)

    const q=match ? match[0] : ""
    console.log(q)
    const param=ref({
      meeting_id: "match",
    })
	  const res = await $meetingPartSearch({ meeting_id: q })
    这个是通过获取dialog title的中的数字并JSON化传入后端后获取数据，不能随着dialog的加载而同步使用，在此仅做记录
    */
    
    
  const res = await $meetingPartSearch(meetingId.value)
    //data.tableData = list
	//alert(data)
    console.log(res,"commonmeeting");
    tableData.value=res.data;
}
loadData()



const emits =defineEmits(['update:model-value'],'initUserList')

const handleClose=()=>{
    emits('update:model-value',false)
}//关闭弹窗





</script>

<style lang="scss" scoped>

</style>